<?php
global $database;
$select ="SELECT ID, name FROM lists WHERE ID_USER = ".$_SESSION['ID'];
$database->query($select);

if ( mysql_num_rows($database->result) <1 )
{
   echo 'Nie utworzyłeś jeszcze żadnej listy.';
   return;
}

echo 'Twoje listy:<br>';
$counter = 1;
while ($r=$database->getResult())
{
   echo '<a href="index.php?module=user&action=showList&name='.$r['name'].'&id='.$r['ID'].'" >';
   echo $counter++.'. ' .$r['name'].'</a>'
   .'&nbsp;<a href="index.php?module=user&action=delList&name='.$r['name'].'&id='.$r['ID'].'"> <img src="images/delete.png" width="12" ></a>'
   .'<br>';
}
?>
